package com.glsc.ngateway.common.api.shortmsg.feign;

import com.glsc.ngateway.common.api.common.config.FeignMultipartSupportConfig;
import com.glsc.ngateway.common.api.shortmsg.bo.MessageGenericVo;
import com.glsc.ngateway.common.api.shortmsg.bo.WebhookGenericVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.constraints.NotNull;
import java.util.List;

@FeignClient(value = "eureka-client-shortmsg", configuration = FeignMultipartSupportConfig.class) // 调用的服务的名称
public interface IFeignShortmsgService {

    @RequestMapping(value = "/shortMessage/sendGroupRobotMessage", method = RequestMethod.POST)
    String sendGroupRobotMessage(@RequestBody WebhookGenericVo webhookGenericVo);

    @PostMapping(value = "/shortMessage/sendAgentMessageGeneric")
    String sendAgentMessageGeneric(@RequestBody @NotNull MessageGenericVo messageGenericVo);

    @PostMapping(value = "/shortMessage/sendAgentMessageGenericBatch")
    List<String> sendAgentMessageGeneric(@RequestBody List<MessageGenericVo> messageGenericVo);
}
